﻿@model Geometry.Core.Triangle
@{
    ViewBag.Title = "Create";
}

<h2>Triangle Checking</h2>

@using (Html.BeginForm("Create", "Triangle", FormMethod.Post, new { id = "triangle-form" }))
{

    <table>
        <tr>
            <td>@Html.DisplayNameFor(model => model.TriangleId)</td>
            <td>
                @Html.DisplayFor(model => model.TriangleId)
            </td>
        </tr>
        <tr>
            <td>@Html.DisplayNameFor(model => model.Side1)</td>
            <td>
                @Html.TextBoxFor(model => model.Side1)
                @Html.ValidationMessageFor(model => model.Side1)
            </td>
        </tr>
        <tr>
            <td>@Html.DisplayNameFor(model => model.Side2)</td>
            <td>
                @Html.TextBoxFor(model => model.Side2)
                @Html.ValidationMessageFor(model => model.Side2)
            </td>
        </tr>
        <tr>
            <td>@Html.DisplayNameFor(model => model.Side3)</td>
            <td>
                @Html.TextBoxFor(model => model.Side3)
                @Html.ValidationMessageFor(model => model.Side3)
            </td>
        </tr>
        <tr>
            <td>@Html.DisplayNameFor(model => model.IsTriangle)</td>
            <td>
                @if (Model.IsTriangle)
                {
                    <input type="checkbox" disabled="disabled" checked="checked" />

                }
                else
                {
                    <input type="checkbox" disabled="disabled" />
                    @*@Html.CheckBoxFor(model => model.IsTriangle,new {@disabled="disabled"})*@
                }

        </td>
    </tr>
    <tr>
        <td>@Html.DisplayNameFor(model => model.TriangleType)</td>
        <td>
            @Html.DisplayFor(model => model.TriangleType)
        </td>
    </tr>
    <tr>
        <td></td>
        <td align="right">
            <input type="submit" value="Check Values" /> |

            <button>@Html.ActionLink("Reset", "Create")</button>
           |<button> @Html.ActionLink("Show Statistic", "Index")</button>
        </td>
    </tr>
</table>
}

@if (Model.TriangleId != 0 && Model.IsTriangle == false)
{
    <span id="msgError" style="color:red">This is not a Triangle</span>
}